#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_pushButton_pressed()
{
    ui->pushButton->setText("松开识别");
    audio =new Audio;
    audio->startAudio("C:\\1\\1.pcm");
}

void Widget::on_pushButton_released()
{
    audio->stopAudio();
    ui->pushButton->setText("开始识别");
    Speech m_speech;
    QString text= m_speech.speechIdentify("C:\\1\\1.pcm");
    ui->textEdit->setText(text);
    ui->pushButton->setText("按住说话");
}

void Widget::on_pushButton_2_clicked()
{
    ui->textEdit->clear();
}
